﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage;

namespace Books.SQLite
{
    public static class File
    {
        public static async Task<bool> FileExistsInPath(string path)
        {
            try
            {
                await StorageFile.GetFileFromPathAsync(path);
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }

        public static async Task<bool> FileExistsInApplication(Uri path)
        {
            try
            {
                await StorageFile.GetFileFromApplicationUriAsync(path);
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }
    }
}